﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HZ.Supervise.Web.Admin
{
    public partial class AuditNoticeList : BasePage
    {
        int temp = 0; 
        HZ.Supervise.IBLL.IExecuteContext im = HZ.Supervise.BLLFactory.ExecuteContext();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                SetBind();
            }
        }  
        /// <summary>
        /// 绑定公告
        /// </summary>
        /// <param name="NoticeType">N2待审核,N3已发布,N1已接收</param>
        private void SetBind()
        { 
            IList<Model.View.Notice> lstNotice = new List<Model.View.Notice>();
            lstNotice = im.GetRecievedNotice(new Model.Query.QNotice() { SortFields = "SendTime DESC", Reciever = CurrentAccount.GetUser().UserRole.RoleID }, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out temp);
            gvwNotice.DataSource = lstNotice;
            this.AspNetPager1.RecordCount = temp;
            gvwNotice.DataBind();
        }

        protected void AspNetPager1_OnPageChanged(object sender, EventArgs e)
        {
            SetBind();
        }
         
    }
}